<?php //pack11class

class AdminLeftMenu extends Module {

    private $pages=array("admin_object_list","translator","specials");

    public function setup() {
        $this->traceEnabled=true;
        $setting=SettingsManager::getSetting("page");
        if(!$setting) return false;
        foreach($this->pages as $pageName) {
            $page=PagesManager::getPage($pageName);
            if($page) {
                $pageSetting=clone $setting;
                $pageSetting->setValue($page->id);
                $queryObject=new GetQueryObject();
                $queryObject->setValue($pageSetting,GetQueryObject::SETTING);
                $query=GetQuery::generate($queryObject);

                $item=new AdminLeftMenuItem();
                $item->link="?state=".$query;
                $item->setBody($page->label);
                $this->addChild($item);
            } else {
                trace("page $pageName not found");
            }

        }
    }

}
?>
